package cn.peifu.hrm.web.controller;

import cn.peifu.hrm.service.IVerifycodeService;
import cn.peifu.hrm.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/verifycode")
public class VerifycodeController {

    @Autowired
    private IVerifycodeService verifycodeService;

    @RequestMapping(value = "/imageCode/{imageCodeKey}" , method = RequestMethod.GET)
    public AjaxResult createImgVerifycode(@PathVariable("imageCodeKey") String imageCodeKey){
        String ImgVerifycode = verifycodeService.createImgVerifycode(imageCodeKey);
        return AjaxResult.me().setResultObj(ImgVerifycode);
    }

}
